using I2.Loc;
using UnityEngine;

public class LocalizeObject : MonoBehaviour
{
	public GameObject enPlane;

	public GameObject ruPlane;

	public Transform lookAt;

	private Material material;

	public float a
	{
		set
		{
			material = enPlane.GetComponent<Renderer>().sharedMaterial;
			Color color = material.GetColor("_Color");
			color.a = value;
			material.SetColor("_Color", color);
			material = ruPlane.GetComponent<Renderer>().sharedMaterial;
			color = material.GetColor("_Color");
			color.a = value;
			material.SetColor("_Color", color);
		}
	}

	public void OnChangeLanguage()
	{
		bool flag = LocalizationManager.IsEnglish();
		enPlane.SetActive(flag);
		ruPlane.SetActive(!flag);
	}

	private void Start()
	{
		OnChangeLanguage();
		SwitchLanguage.onChangeLanguage += OnChangeLanguage;
	}

	private void Update()
	{
		if (lookAt != null)
		{
			enPlane.transform.LookAt(lookAt);
			ruPlane.transform.LookAt(lookAt);
		}
	}

	private void OnDestroy()
	{
		SwitchLanguage.onChangeLanguage -= OnChangeLanguage;
	}
}
